import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter);

let originPush = VueRouter.prototype.push;
let originReplace = VueRouter.prototype.replace;

//location 路由位置, 成功 失败 的传参
VueRouter.prototype.push = function(location,access,error){
    if(access && error){
        originPush.call(this,location,access,error);
    }else{
        originPush.call(this,location,()=>{},()=>{});
    }

}

VueRouter.prototype.replace = function(location,access,error){
    if(access && error){
        originReplace.call(this,location,access,error);
    }else{
        originReplace.call(this,location,()=>{},()=>{});
    }

}
export default new VueRouter({
    mode: 'history',
    routes:[
        {
            path: '/',
            name: 'Table',
            // 添加你的组件
            component: () => import('@/components/table/index.vue')
        },
        {
            path: '/showecharts',
            name: 'showecharts',
            component: () => import('@/components/table/showecharts.vue')
        },
    ]
})
  



